<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        window.onload = function () {
           var btn = document.getElementById("btnId");
           btn.onclick = function () {
                /*var test = document.getElementById("test");
                test.value = "abc";*/
                var inputs = document.getElementsByTagName("input");
               for (var i = 0; i < inputs.length; i++) {
                    inputs[i].value = "hello";
               }
           };
           var testA = document.getElementById("testA");
           testA.onmouseover = function () {
               testA.style.fontSize = "24px";
           };
            testA.onmouseout = function () {
                testA.style.fontSize = "12px";
            };
        };
    </script>
</head>
<body>
<input type="text" id="test">
<input type="button" value="变" id="btnId">
<a href="aaa" id="testA" style="font-size: 12px;">点击有惊喜</a>
</body>
</html>